package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.core.domain.model.BasicsBody;
import com.ruoyi.common.core.domain.model.NumBody;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ShopCompanyInfoMapper;
import com.ruoyi.system.domain.ShopCompanyInfo;
import com.ruoyi.system.service.IShopCompanyInfoService;

/**
 * 公司信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-03
 */
@Service
public class ShopCompanyInfoServiceImpl implements IShopCompanyInfoService 
{
    @Autowired
    private ShopCompanyInfoMapper shopCompanyInfoMapper;

    /**
     * 查询公司信息
     * 
     * @param companyId 公司信息主键
     * @return 公司信息
     */
    @Override
    public ShopCompanyInfo selectShopCompanyInfoByCompanyId(Long companyId)
    {
        return shopCompanyInfoMapper.selectShopCompanyInfoByCompanyId(companyId);
    }

    /**
     * 查询公司信息列表
     * 
     * @param shopCompanyInfo 公司信息
     * @return 公司信息
     */
    @Override
    public List<ShopCompanyInfo> selectShopCompanyInfoList(ShopCompanyInfo shopCompanyInfo)
    {
        return shopCompanyInfoMapper.selectShopCompanyInfoList(shopCompanyInfo);
    }

    /**
     * 新增公司信息
     * 
     * @param shopCompanyInfo 公司信息
     * @return 结果
     */
    @Override
    public int insertShopCompanyInfo(ShopCompanyInfo shopCompanyInfo)
    {
        shopCompanyInfo.setCreateTime(DateUtils.getNowDate());
        return shopCompanyInfoMapper.insertShopCompanyInfo(shopCompanyInfo);
    }

    /**
     * 修改公司信息
     * 
     * @param shopCompanyInfo 公司信息
     * @return 结果
     */
    @Override
    public int updateShopCompanyInfo(ShopCompanyInfo shopCompanyInfo)
    {
        shopCompanyInfo.setUpdateTime(DateUtils.getNowDate());
        return shopCompanyInfoMapper.updateShopCompanyInfo(shopCompanyInfo);
    }

    /**
     * 批量删除公司信息
     * 
     * @param companyIds 需要删除的公司信息主键
     * @return 结果
     */
    @Override
    public int deleteShopCompanyInfoByCompanyIds(Long[] companyIds)
    {
        return shopCompanyInfoMapper.deleteShopCompanyInfoByCompanyIds(companyIds);
    }

    /**
     * 删除公司信息信息
     * 
     * @param companyId 公司信息主键
     * @return 结果
     */
    @Override
    public int deleteShopCompanyInfoByCompanyId(Long companyId)
    {
        return shopCompanyInfoMapper.deleteShopCompanyInfoByCompanyId(companyId);
    }

    @Override
    public ShopCompanyInfo getShopCompanyInfoTotal()
    {
        return shopCompanyInfoMapper.getShopCompanyInfoTotal();
    }

    @Override
    public int updateCompanyAndUserInfo(BasicsBody basicsBody) {
        return shopCompanyInfoMapper.updateCompanyAndUserInfo(basicsBody);
    }

    @Override
    public NumBody getNumByAll() {
        return shopCompanyInfoMapper.getNumByAll();
    }
}
